﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using AresCustomYacht.Code;
using AresCustomYacht.DataContract;

namespace AresCustomYacht
{
    public class BL
    {
        readonly DAL _dal = new DAL();

        public List<Summary> GetCostSummaryReport(int reportDetailId, int boatId, string parameters)
        {
            //TODO: Parameters can be comma separaterd
            return null;
        }

        public List<Summary> GetCostDetailByTrade(int reportDetailId, int boatId, string tradeString)
        {
            //TODO: Parameters can be comma separaterd
            //Get the TradeId using parameter

            return _dal.GetCostDetailByTrade(boatId, tradeString);
        }

        public List<Summary> GetCostDetailByLocation(int reportDetailId, int boatId, string tradeString)
        {
            //TODO: Parameters can be comma separaterd
            //Get the TradeId using parameter

            return _dal.GetCostDetailByLocation(boatId, tradeString);
        }

        public List<DataContract.Boat> GetBoats()
        {
            return _dal.GetBoats();
        }



        internal Code.Boat GetBoat(Guid userId)
        {
            return _dal.GetBoat(userId);
        }

        internal Code.Boat GetBoat(int boatId)
        {
            return _dal.GetBoat(boatId);
        }

        internal ReportDetail GetReportDetail(int reportDetailId)
        {
            return _dal.GetReportDetail(reportDetailId);
        }

        internal List<ReportDetail> GetReportDetails()
        {
            return _dal.GetReportDetails();
        }

        internal List<Report> GetReports()
        {
            return _dal.GetReports();
        }


        internal List<Division> GetDivisions()
        {
            return _dal.GetDivisions();
        }

        public List<Trade> GetDivisionTrades(int divisionId)
        {
            return _dal.GetDivisionTrades(divisionId);
        }

        public List<Location> GetClassLocations(int classId)
        {
            return _dal.GetTradeLocations(classId);
        }

        internal List<Task> GetLocationTasks(int locationId)
        {
            return _dal.GetLocationsTasks(locationId);
        }


        internal Task GetTask(int taskId)
        {
            return _dal.GetTask(taskId);
        }



        internal Tracking GetTrack(int trackId)
        {
            return _dal.GetTrack(trackId);
        }

        internal void AddBoat(string boatName, Guid ownerId)
        {
            _dal.AddBoat(boatName, ownerId);
        }

        internal void AddDivisions(Dictionary<string, string> divisions)
        {
            _dal.AddDivisions(divisions);
        }

        internal void AddDepartments(int parentId, Dictionary<string, string> dataDictionary)
        {
            _dal.AddDepartments(parentId, dataDictionary);
        }

        internal void AddLocations(int parentId, Dictionary<string, string> dataDictionary)
        {
            _dal.AddLocations(parentId, dataDictionary);
        }

        internal void AddTypes(int parentId, Dictionary<string, string> dataDictionary)
        {
            _dal.AddTasks(parentId, dataDictionary);
        }

        internal void AddTasks(int parentId, Dictionary<string, string> dataDictionary)
        {
            _dal.AddTasks(parentId, dataDictionary);
        }
    }
}